import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import axios from 'axios'
import VueAxios from 'vue-axios'

Vue.use(VueAxios,axios)//全局通用


Vue.use(ElementUI);

Vue.config.productionTip = false;



router.beforeEach((to, from, next) => {
       
  // console.log(to);

if(to.meta.t||localStorage.getItem("name")){

  next()  
}else{
  alert("请登录！")
  // next(this.$router.push())
  router.push({path:"/"})
}
})


new Vue({
  router,
  render: (h) => h(App),
}).$mount("#app");
